import {queryBook} from "@/api";

const state = {
    bookList: []
};
const mutations = {
    QUERYBOOK(state, bookList) {
        //state.bookList.push(bookList);
        state.bookList=bookList
    },
    CLEAR(state) {
        state.bookList = [];
    },
};
const actions = {
    async queryBook({commit}, params = {}) {
        let response = await queryBook(params);
        if (response.code == 200) {
            commit("QUERYBOOK", response.data)
        }
    },
    clear({commit}) {
        commit("CLEAR")
    },
};
const getters = {};

export default {
    state,
    mutations,
    actions,
    getters
}
